#define  _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <memory>
using namespace std;

class Product
{
public:
	virtual void getName() = 0;
	virtual ~Product() {};
};

class ConcreteProductA : public Product
{
public:
	void getName()
	{
		cout << "ConcreteProductA" << endl;
	}
};

class ConcreteProductB : public Product
{
public:
	void getName()
	{
		cout << "ConcreteProductB" << endl;
	}
};

class ConcreteProductC : public Product
{
public:
	void getName()
	{
		cout << "ConcreteProductC" << endl;
	}
};

class Creator
{
public:
	virtual Product* getConcreteProductA() = 0;
	virtual  Product* getConcreteProductB() = 0;
	virtual  unique_ptr<Product> getConcreteProductC() = 0;
	virtual ~Creator() {};
};

class ConcreteCreator : public Creator
{
public:
	Product* getConcreteProductA()
	{
		return new ConcreteProductA;
	}

	Product* getConcreteProductB()
	{
		return new ConcreteProductB;
	}

	unique_ptr<Product> getConcreteProductC()
	{
		return unique_ptr<Product>(new ConcreteProductC);
	}
};

//int main()
//{
//	ConcreteCreator* creator = new ConcreteCreator;
//	creator->getConcreteProductA()->getName();
//	creator->getConcreteProductB()->getName();
//	creator->getConcreteProductC().get()->getName();
//	return 0;
//}